#!/usr/bin/python
# -*- coding: utf-8 -*-


import oauth
from binder import bind_api
from parsers import ModelParser


class RenrenAPI(object):
    """class for Renren API"""
    def __init__(self, consumer, access_token=None, \
                 refresh_token=None, host='graph.renren.com'):
        """constructor for RenrenAPI"""
        self.consumer = consumer
        self.access_token = access_token
        self.refresh_token = refresh_token
        self.host = host
        self.parser = ModelParser()

    """oauth 1.0"""
    """/oauth/token 使用用户名, 密码方式"""
    get_access_token= bind_api(
        url='/oauth/token',
        method='POST',
        ssl=True,
        data_type='token',
        data_format='json',
        allowed_params=['grant_type', 'username', 'password', \
                        'client_id', 'client_secret', 'scope']
    )

    
if __name__ == "__main__":
    pass
